package com.hq.ims.data.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.*;
import com.hq.ims.data.vo.CompanyEmployeeMapstruct;
import com.hq.mybatis.base.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.Alias;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author 蒋柏平
 * @since 20240927
 */
@Data
@Alias("CompanyEmployee")
@TableName(value = "company_employee")
@ApiModel(value = "公司人员表", description = "公司人员表")
public class CompanyEmployee extends BaseModel<CompanyEmployee> implements Serializable {

    @ApiModelProperty(value = "主键")
    @TableId(value = "company_employee_id", type = IdType.ASSIGN_UUID)
    private String companyEmployeeId;

    @ApiModelProperty(value = "创建时间 - 不需程序员处理")
    @TableField(value = "create_date_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createDateTime;

    @ApiModelProperty(value = "版本号")
    @TableField(value = "version")
    @Version
    private Integer version;

    @ApiModelProperty(value = "更新时间 - 不需程序员处理")
    @TableField(value = "update_date_time", fill = FieldFill.INSERT_UPDATE)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateDateTime;

    @ApiModelProperty(value = "创建用户名称")
    @TableField(value = "create_user_name", fill = FieldFill.INSERT)
    private String createUserName;

    @ApiModelProperty(value = "更新用户名")
    @TableField(value = "update_user_name", fill = FieldFill.INSERT_UPDATE)
    private String updateUserName;

    @ApiModelProperty(value = "公司ID(关联company)")
    @TableField(value = "company_id")
    private String companyId;

    @ApiModelProperty(value = "公司名称")
    @TableField(value = "company_name")
    private String companyName;

    @ApiModelProperty(value = "部门id(关联company_department)")
    @TableField(value = "department_id")
    private String departmentId;

    @ApiModelProperty(value = "部门名称")
    @TableField(value = "department_name")
    private String departmentName;

    @ApiModelProperty(value = "用户ID(关联user)")
    @TableField(value = "user_id")
    private String userId;

    @ApiModelProperty(value = "是否系统管理员")
    @TableField(value = "is_admin")
    private Boolean isAdmin;

    @ApiModelProperty(value = "是否离开公司")
    @TableField(value = "is_resign")
    private Boolean isResign;

    @ApiModelProperty(value = "是否为兼职")
    @TableField(value = "is_part_time_job")
    private Boolean isPartTimeJob;

    public CompanyEmployeeMapstruct.CompanyEmployeeRowAuthVo auth() {
        CompanyEmployeeMapstruct.CompanyEmployeeRowAuthVo auth = new CompanyEmployeeMapstruct.CompanyEmployeeRowAuthVo(this);
        return auth;
    }

}
